package types

import (
	"time"
)

type Paper struct {
	CommonFields
	Title         string `db:"title"`
	RoleType      int8   `db:"roleType"`
	Description   string `db:"description"`
	AnswerChoices string `db:"answerChoices"`
	Code          string `db:"code"`
	Price         int32  `db:"price"`

	//以下为非数据库字段....
	HasDone       bool      `db:"hasDone"`
	ConvertStatus int8      `db:"convertStatus"`
	DoneTime      time.Time `db:"doneTime"`
}

type PaperQuestionChoice struct {
	CommonFields
	QuestionId int64  `db:"questionId"`
	Order      uint16 `db:"order"`
	Type       int8   `db:"type"`
	Content    string `db:"content"`
}

type PaperQuestion struct {
	CommonFields
	PaperId int64  `db:"paperId"`
	Order   uint16 `db:"order"`
	Type    int8   `db:"type"`
	Content string `db:"content"`

	//以下为非数据库字段....
	Choices []PaperQuestionChoice `db:"choices"`
}

type PaperUserAnswer struct {
	CommonFields
	QuestionId int64  `db:"questionId"`
	UserId     int64  `db:"userId"`
	Answer     string `db:"answer"`
}

type PaperUserDone struct {
	CommonFields
	UserId  int64 `db:"userId"`
	PaperId int64 `db:"paperId"`

	//以下为非数据库字段....
	HasDone bool `db:"hasDone"`
}
